exports.path = '/task/qryTasks';
exports.title = '按条件查询匹配的任务单';
// 本范例首先展示 select SQL query 场景

exports.sqltext = ({
  columns, mbssMenuId, stageId, stageIds,
}) => {
  const whereStageIds = stageIds ? `and t.STAGE_ID in (${stageIds.join(',')})` : '';
  return `
select ${columns || 't.*'}, 1 as num,
to_char(t.create_time, 'yyyy-mm-dd hh24:mi:ss') as "createTime"
from tf_mbss_tasks t
where rownum<=3
${mbssMenuId ? 'and t.MBSS_MENU_ID = :mbssMenuId' : ''}
${stageId ? 'and t.STAGE_ID = :stageId' : ''}
${whereStageIds}
`;
};

exports.pool = 'task';

// 请求范例，用于调用者了解请求数据结构，也用于系统自动内测发起请求
exports.request = {
  mbssMenuId: 'wohome',
  stageId: '59o',
  columns: 'MBSS_MENU_ID,59o',
};
